package com.kim.smartring.net.business;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import com.kim.smartring.db.model.HeartRateRecord;
import com.kim.smartring.db.model.SleepRecord;
import com.kim.smartring.db.model.StepRecord;
import com.kim.smartring.utils.DateUtils;

public class SyncUtils {

	/**
	 * 同步记步信息
	 */
	public static List<StepRecord> syncStepsInfo() {
		StepRecord record = null;
		List<StepRecord> records = new ArrayList<StepRecord>();

		for (int i = 0; i < 50; i++) {
			record = new StepRecord();
			record.setSid(UUID.randomUUID().toString());
			record.setDay(DateUtils.getCurrentDay());
			record.setsCalories(1234 + i);
			record.setsCount(5634 + i);
			record.setsDistance(23523 + i);
			record.setsTimeStart(System.currentTimeMillis());
			record.setsTimeEnd(System.currentTimeMillis());
			record.setYearMonth(DateUtils.getYearMonth());
			record.setSynchronousTime(new Date().getTime());
			records.add(record);
		}
		return records;
	}

	/**
	 * 同步睡眠信息
	 */
	public static List<SleepRecord> syncSleepQualityInfo() {
		SleepRecord record = null;
		List<SleepRecord> records = new ArrayList<SleepRecord>();

		for (int i = 0; i < 5; i++) {
			record = new SleepRecord();
			record.setSid(UUID.randomUUID().toString());
			record.setDay(DateUtils.getCurrentDay());
			Date date = new Date();
			date.setDate(date.getDate() +i);
			record.setsRecordTime(date.getTime());
			record.setsTime(1000 * 60 * 60 * 4);
			record.setsType(1);
			record.setYearMonth(DateUtils.getYearMonth());
			record.setSynchronousTime(date.getTime());
			records.add(record);
		}
		return records;
	}

	/**
	 * 同步心率信息
	 */
	public static List<HeartRateRecord> syncHeartRateInfo() {
		HeartRateRecord record = null;
		List<HeartRateRecord> records = new ArrayList<HeartRateRecord>();

		for (int i = 0; i < 50; i++) {
			record = new HeartRateRecord();
			record.setHid(UUID.randomUUID().toString());
			record.setDay(DateUtils.getCurrentDay());
			Date date = new Date();
			record.sethTime(date.getTime());
			record.sethValue(68 + i);
			record.setYearMonth(DateUtils.getYearMonth());
			record.setSynchronousTime(date.getTime());
			records.add(record);
		}
		return records;
	}
}
